﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StringAsBytesPrinter
{
    class StringAsBytesPrinter
    {
        public static void PrintStringAsBytes(string str)
        {
            Encoding utf8 = Encoding.UTF8;
            byte[] bytes = utf8.GetBytes(str);
            foreach (byte symbol in bytes)
            {
                Console.Write("\\x{0:X}", symbol);
            }
            Console.WriteLine();
        }

        static void Main()
        {
            string inputString = "Hi!";
            PrintStringAsBytes(inputString);
        }
    }
}
